const path = require("path")
const merge = require('webpack-merge')
const {bases} = require('./webpack.base')
module.exports = merge(bases,{ //webpack基于node构建的
    mode: "production",
    watch: true,
    watchOptions: {
        poll: 1000,
        // aggregateTimeOut: 500,
        ignored: /node_modules/
    },
    //production 提供了约定大于配置 约定打包文件是src/index ->dist/main
    devServer: {
        port: 7000,
        hot: true,
        grogress: true,
        historyApiFallback: true
        //true 表示webpack支持使用history false路由默认是hash
    },
    devtool:"source-map",
    performance: {
        hints: 'warning', //false关闭提示 下面设置就没必要了
        //入口起点的最大体积
        maxEntrypointSize: 50000000,
        //生成文件的最大体积
        maxAssetSize: 30000000,
        //只给出 js 文件的性能提示
        assetFilter: function (assetFilename) {
            return assetFilename.endsWith('.js');
        }
    }
})